package vo {
	import org.davekeen.flextrine.orm.PersistentCollection;
	import org.davekeen.flextrine.orm.FlextrineError;
  	import vo.Movie;
  
	[Bindable]
	public class ArtistEntityBase {
		
		public var isUnserialized__:Boolean;
		
		public var isInitialized__:Boolean = true;
		
		public var isCollectionInitializedMap__:Object = new Object();
		
		[Id]
		public var id:String;
		
		public function get name():String { checkIsInitialized("name"); return _name; }
		public function set name(value:String):void { _name = value; }
		private var _name:String;
		
		[Association]
		public function get movies():PersistentCollection { checkIsInitialized("movies"); return _movies; }
		public function set movies(value:PersistentCollection):void { _movies = value; }
		private var _movies:PersistentCollection;
		
		public function ArtistEntityBase() {
			movies = new PersistentCollection();
		}
		
		public function toString():String {
			return "[Artist id=" + id + "]";
		}
		
		private function checkIsInitialized(property:String):void {
			if (!isInitialized__ && isUnserialized__)
				throw new FlextrineError("Attempt to get property '" + property + "' on unitialized Artist.  Consider using EntityManager::require or eager loading.", FlextrineError.ACCESSED_UNITIALIZED_ENTITY);
		}
		
	}

}
